﻿@model GPS.ENTITYS.ViewModelDSH
@using PagedList.Mvc;
@using GPS.Helpers;
@{
    ViewBag.Title = "Thông tin sát hạch";
}

<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
<script src="~/Scripts/jquery.maskedinput.js"></script>
<script src="~/Scripts/datepicker.js"></script>

<div class="container fdb-div-content fdb-div-corner-all">
    <h3 class="text-center fdb-title-search-form">Thông Tin Sát hạch</h3>
    <div class="row">
        @using (Html.BeginForm("Index", "GPS_ThongTinSatHach", FormMethod.Get))
        {

            <div class="list-group">
                <fieldset class="fs_body">
                    <legend class="head_title">Điều Kiện Tìm Kiếm</legend>

                    <div class="criteria_search">
                        <br />
                        <div class="row">
                            <div class="col-md-2 control-label">
                                Mã sát hạch
                            </div>
                            <div class="col-md-4">
                                @Html.TextBoxFor(model => model.pSH_MA, new { @class = "form-control" })
                            </div>
                            <div class="col-md-2 control-label">
                                Số quyết định sát hạch
                            </div>
                            <div class="col-md-4">
                                @Html.TextBoxFor(model => model.pSH_SOQD, new { @class = "form-control" })
                            </div>
                        </div>

                        <div class="row margin-top-05">
                            <div class="col-md-2 control-label">
                                Đơn vị GTVT
                            </div>
                            <div class="col-md-4">
                                @Html.DropDownListFor(model => model.pSH_DVGTVT_MA, (SelectList)ViewBag.pSH_DVGTVT_MAs, string.Empty, new { @class = "form-control", @id = "pSH_DVGTVT_MA_dll" })
                            </div>
                            <div class="col-md-2 control-label">

                            </div>
                            <div class="col-md-4">

                            </div>
                        </div>
                        <div class="row margin-top-05">
                            <div class="col-md-2 control-label">
                                Ngày sát hạch từ
                            </div>
                            <div class="col-md-4">

                                @Html.TextBoxFor(model => model.pSH_NGAY_TU, "{0:dd/MM/yyyy}", new { @class = "form-control", @style = "width:120px" })
                            </div>

                            <div class="col-md-2 control-label">
                                Đến
                            </div>
                            <div class="col-md-4">
                                @Html.TextBoxFor(model => model.pSH_NGAY_DEN, "{0:dd/MM/yyyy}", new { @class = "form-control", @style = "width:120px" })

                            </div>
                        </div>


                    </div>

                    <div class="row margin-top-05 btn_search">
                        <button type="submit" class="btn btn-warning btn-sm">
                            <span class="glyphicon glyphicon-search"></span> Tìm kiếm
                        </button>
                    </div>
                </fieldset>
            </div>
        }
        <br />
        <div id="dialog"></div>
        <div class="row">
            <fieldset class="fs_body">
                <legend class="head_title">Kết quả tìm kiếm</legend>

                <div class="row divbtnFielset">
                    <div style="float: left;">
                        @Html.NoEncodeActionLink("<span class='glyphicon glyphicon-plus'></span> Thêm mới", "Thêm mới", "Create", "GPS_ThongTinSatHach", null, htmlAttributes: new { @class = "btn btn-warning btn-sm" })
                        @*<button type="submit" class="btn btn-primary btn-sm" name="SearchButton" value="Xuất Excel">
                                <i class='fa fa-file-excel-o'></i> Xuất Excel
                            </button>
                            @Html.NoEncodeActionLink("<i class='fa fa-file-excel-o'></i> Import Excel", "Import Excel", "ImportExcel", "GPS_MonHoc", null, htmlAttributes: new { @class = "btn btn-primary btn-sm" })*@
                    </div>
                    <div style="float: right;">
                        <label id="lblMessageTotal" style="color:blue; font-weight:bold">Tổng số bản ghi: @ViewBag.TotalRow</label>
                    </div>
                </div>

                <div class="row" style="clear:both; padding: 5px 0;">
                    <table class="table table-hover table-bordered table-condensed">
                        <tr>
                            <th>
                                Mã Sát hạch
                            </th>
                            <th>
                                Tên kỳ SH
                            </th>
                            <th>
                                Đơn vị GTVT
                            </th>
                            <th>
                                Số QĐSH
                            </th>
                            <th>
                                Ngày QĐSH
                            </th>
                            <th>
                               Người QĐSH
                            </th>
                            <th>
                                Ngày SH
                            </th>
                            <th>
                                Giờ SH
                            </th>
                            <th>
                                Chủ tịch HĐSH
                            </th>
                            <th></th>
                        </tr>
                        @{
                            if (Model.SearchResults != null)
                            {
                                foreach (var item in Model.SearchResults)
                                {
                                    <tr>
                                        <td>
                                            @Html.DisplayFor(modelItem => item.SH_MA)
                                        </td>
                                        <td>
                                            @Html.DisplayFor(modelItem => item.SH_TENKYSH)
                                        </td>
                                        <td>
                                            @Html.DisplayFor(modelItem => (item.SH_DVGTVT_MA))
                                        </td>
                                        <td>
                                            @Html.DisplayFor(modelItem => (item.SH_SOQD))
                                        </td>
                                        <td>
                                            @Html.DisplayFor(modelItem => (item.SH_NGAYQD))
                                        </td>
                                        <td>
                                            @Html.DisplayFor(modelItem => (item.SH_NGUOIQD))
                                        </td>
                                        <td>
                                            @Html.DisplayFor(modelItem => (item.SH_NGAY))
                                        </td>
                                        <td>
                                            @Html.DisplayFor(modelItem => (item.SH_GIO))
                                        </td>
                                        <td>
                                            @Html.DisplayFor(modelItem => (item.SH_CT_HDSH))
                                        </td>

                                        <td align="center">
                                            <div class="pull-right">
                                                @*<a href="@Url.Action("Detail", "GPS_ThongTinSatHach", new { id1 = item.SH_MA, id2 = item.SH_DVGTVT_MA })" data-modal="">
                                                    <img src="@Url.Content("~/fonts/grid-view-icon.png")" title="Xem chi tiết" />
                                                </a>*@
                                                <a href="@Url.Action("Edit", "GPS_ThongTinSatHach", new { id = item.ID })">
                                                    <img src="@Url.Content("~/fonts/grid-edit-icon.png")" title="Sửa thông tin sát hạch" />
                                                </a>
                                                <a href="@Url.Action("Delete", "GPS_ThongTinSatHach", new { id = item.ID })" onclick="return confirm('Bạn Thật Sự Muốn Xóa thông tin sát hạch này?')">
                                                    <img src="@Url.Content("~/fonts/grid-delete-icon1.gif")" title="Hủy thông tin sát hạch" />
                                                </a>
                                            </div>
                                        </td>
                                    </tr>
                                }
                            }
                        }

                    </table>
                </div>

                <div class="pagination-sm row" style="clear:both; padding: 5px 0;">
                    @Html.PagedListPager(Model.SearchResults, page => Url.Action("Index", new
   {
       page,
       Model.pSH_MA,
       Model.pSH_DVGTVT_MA,
       Model.pSH_SOQD,
       Model.pSH_NGAY_TU,
       Model.pSH_NGAY_DEN
   }))
                </div>
            </fieldset>

        </div>
    </div>
</div>


<!-- delete modal placeholder-->
<div id='deleteModal' class='modal fade in'>
    <div class="modal-dialog">
        <div class="modal-content">
            <div id='deleteModalContent'></div>
        </div>
    </div>
</div>

<!-- modal placeholder-->
<div id='myModal' class='modal fade in'>
    <div class="modal-dialog" >
        <div class="modal-content">
            <div id='myModalContent'></div>
        </div>
    </div>
</div>


@section Scripts {
    @Scripts.Render("~/bundles/modalform")
}

<script type="text/javascript">

    $("#pSH_NGAY_TU").datepicker({
        changeMonth: true,
        changeYear: true,

        dateFormat: 'dd/mm/yy'
    });
    $("#pSH_NGAY_TU").mask("99/99/9999", { placeholder: "dd/mm/yyyy" });

    $("#pSH_NGAY_DEN").datepicker({
        changeMonth: true,
        changeYear: true,

        dateFormat: 'dd/mm/yy'
    });
    $("#pSH_NGAY_DEN").mask("99/99/9999", { placeholder: "dd/mm/yyyy" });


    $(function () {
        $(document).tooltip();
    });

</script>


